package com.zhenyi.tuangou.index;

import com.zhenyi.common.model.TgAddress;
import com.zhenyi.common.model.TgUser;


public class AddressController extends TGController {
	/**
	 * 新增地址
	 */
	public void addAddress() {
		String name = getPara("name");
		String tel = getPara("tel");
		String address = getPara("address");
		int tag = getParaToInt("tag", 4);
		String contury = getPara("contury");
		String province = getPara("province");
		String city = getPara("city");
		int post = getParaToInt("post");

		TgAddress add = new TgAddress();
		add.setAddress(address);
		add.setName(name);
		add.setTag(tag);
		add.setTel(tel);
		add.setContury(contury);
		add.setProvince(province);
		add.setCity(city);
		add.setPost(post);

		TgUser user = getUser();
		add.setUserId(user.getId());
		add.save();
		setAttr("result", "ok");
	}

//	@Clear
//	public void aa(){
//		CloseGroupTask groupTask = new CloseGroupTask();
//		Thread thread  = new Thread(groupTask);
//		thread.start();
//		renderJson("okok");
//	}
	
}
